package com.erp.service.impl;

import com.erp.entity.Goods;
import com.erp.entity.vo.GoodsVO;
import com.erp.mapper.GoodsMapper;
import com.erp.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author pyj
 * @since 2020-11-07
 */
@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;
    
    @Override
    public List<Goods> findGoodsByName(String name) {
        return goodsMapper.findGoodsByName(name);
    }

    @Override
    public List<GoodsVO> getAll() {
        return goodsMapper.getAll();
    }

    @Override
    public int add(Goods goods) {
        return goodsMapper.add(goods);
    }

    @Override
    public int delete(Integer id) {
        return goodsMapper.delete(id);
    }

    @Override
    public int update(Goods goods) {
        return goodsMapper.update(goods);
    }

    @Override
    public Goods findById(Integer id) {
        return goodsMapper.findById(id);
    }
}
